<page-header [autoTitle]="false" *ngIf="!centerId"></page-header>
<nz-card [nzBordered]="!centerId">
  <section class="search-section">
    <input nz-input placeholder="店铺名称、负责人姓名、手机" [(ngModel)]="keyword" class="search-item"/>
    <button nz-button [nzType]="'primary'" nzGhost (click)="search()" class="search-item">
      <i class="anticon anticon-search"></i><span>搜索</span>
    </button>
    <!--<button nz-button [nzType]="'primary'" (click)="editEntity({})" class="search-add-right">-->
      <!--<i class="anticon anticon-plus"></i><span>添加</span>-->
    <!--</button>-->
  </section>
  <nz-table #nzTable [nzData]="page.content"
            [nzPageSize]="page.size"
            [nzTotal]="page.totalElements"
            [nzFrontPagination]="false"
            [(nzPageIndex)]="page.number"
            (nzPageIndexChange)="changePageNo($event)"
            [nzLoading]="isLoading">
    <thead>
    <tr>
      <th><span>序号</span></th>
      <th><span>店铺名称</span></th>
      <th><span>品牌名称</span></th>
      <th *ngIf="!centerId"><span>运营中心</span></th>
      <th><span>业务经理</span></th>
      <th><span>负责人姓名</span></th>
      <th><span>负责人手机</span></th>
      <th><span>省</span></th>
      <th><span>市</span></th>
      <th><span>区县</span></th>
      <th><span>申请状态</span></th>
      <th><span>正常营业</span></th>
      <th><span>操作</span></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data;let i=index">
      <td>
        {{i+1}}
      </td>
      <td>{{data.title}}</td>
      <td>{{data.brandName}}</td>
      <td *ngIf="!centerId">{{data.centerTitle}}</td>
      <td>{{data.name}}</td>
      <td>{{data.shopkeeperName}}</td>
      <td>{{data.shopkeeperPhone}}</td>
      <td>{{data.province}}</td>
      <td>{{data.city}}</td>
      <td>{{data.county}}</td>
      <td>{{data.auditingStatus|dicsNamePipe:shopAuditingStatus}}</td>
      <td>{{data.status|yesNoPipe}}</td>
      <td>
        <a href="javascript:void (0);" (click)="editEntity(data)">查看详情</a>
        <nz-divider nzType="vertical"></nz-divider>
        <a  href="javascript:void (0);" (click)="seeLog(data)">规则日志</a>
        <nz-divider nzType="vertical"></nz-divider>
        <nz-dropdown>
          <a nz-dropdown>
            更多 <i class="anticon anticon-down"></i>
          </a>
          <ul nz-menu nzSelectable>
            <li nz-menu-item>
              <a href="{{wxPublicImgDomain+data.publicTicket}}" download="{{data.title+'.png'}}"
                 target="_blank">店铺二维码</a>
            </li>
            <li nz-menu-item *ngIf="data.ruleDefault == 2">
              <a href="javascript:void (0);" (click)="setShopRule(data)">奖励规则</a>
            </li>
            <li nz-menu-item *ngIf="data.auditingStatus == 3">
              <nz-popconfirm [nzTitle]="'确认该店铺已停止营业吗？'" (nzOnConfirm)="onsale(data)">
                <a nz-popconfirm *ngIf="data.status == 1">停止营业</a>
              </nz-popconfirm>
              <nz-popconfirm [nzTitle]="'确认该店铺恢复正常营业吗？'" (nzOnConfirm)="onsale(data)">
                <a nz-popconfirm *ngIf="data.status == 2">正常营业</a>
              </nz-popconfirm>
            </li>
            <li nz-menu-item *ngIf="data.auditingStatus != 3">
              <nz-popconfirm [nzTitle]="'确定该店铺信息正常，审核通过该店铺吗？'" (nzOnConfirm)="confirmAuditing(data)">
                <a nz-popconfirm>通过</a>
              </nz-popconfirm>
            </li>
            <li nz-menu-item *ngIf="data.auditingStatus == 1">
              <a href="javascript:void (0);" (click)="rejectAuditing(data)">驳回</a>
            </li>
          </ul>
        </nz-dropdown>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>
